package com.github.cyf.controller;

import com.github.cyf.common.model.Rs;
import com.github.cyf.entity.UserVo;
import com.github.cyf.entity.group.CrudGroup;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenyifan
 * @create 2024-05-07 21:42
 */
@RestController
@RequestMapping("/group")
@Validated
@Api(tags = "3、分组校验")
@ApiSupport(order = 3)
public class GroupController {

    @PostMapping("/create")
    public Rs createUser(@RequestBody @Validated(value = CrudGroup.Create.class) UserVo user) {
        return Rs.ok("校验成功").setData(user);
    }

    @PostMapping("/update")
    public Rs updateUser(@RequestBody @Validated(value = CrudGroup.Update.class) UserVo user) {
        return Rs.ok("校验成功").setData(user);
    }

}
